<script setup>
  let userId = document.querySelector('#user-id').value
  let userPassword = document.querySelector('#user-password').value
  let handlelogin = ()=> {
    fetch({
          method: 'POST',
          headers:{
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({data: {userId: userId, userPassword: userPassword}})
        }
    ).then(response=>response()).then(data=>{
      if(data.status===200){
        alert("success!")
      }
    })
  };
</script>

<template>
  <div>This is a test page!</div>
  <input type="user-id">
  <input type="user-password">
  <button @click="handlelogin">登录</button>
</template>

<style scoped>

</style>